#define _CRT_SECURE_NO_WARNINGS 1
#include <stdint.h>
#include <stdio.h>
long fun(char str[]) {
    int i;
    long s = 0, t;
    for (int i = 0; str[i] != '\0'; i++) {
        t = 0;
        while (str[i] >= '0' && str[i] <= '9') {
            t = t * 10 + str[i] - '0';
            i++;
        }
        s = s + t;
    }
    return s;
}
int main() {
    char string[] = "Welcome123To456DuoYi789!";
    long len;
    len = fun(string);
    printf("%ld\n", len);
    return 0;
}